#ifndef __KALMAN_FILTER_H__
#define __KALMAN_FILTER_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <math.h>


typedef struct
{
  float in;
  float out;
  float x;  // 状态变量
  float F;  // 状态转移模型
  float P;  // 预测协方差
  float x_pred;
  float P_pred;
  float K;  // 卡尔曼增益
  float Q;  // 过程噪声协方差
  float R;  // 测量噪声协方差
} k_filter_f32_t;


int32_t k_filter_update_f32(k_filter_f32_t *k_filter);


#ifdef __cplusplus
}
#endif

#endif


